﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace DataManager
{
    public static class Logs
    {
        public static string Path { get; set; }
        public static void Write(Exception ex)
        {
            FileStream fs = new FileStream(Path + "/Logs.txt", FileMode.OpenOrCreate);
            StreamWriter sw = new StreamWriter(fs);
            sw.WriteLine("[" + DateTime.Now.ToString("dd/MM/yyyy HH:mm") + "]");
            sw.WriteLine(ex.Message);
            sw.WriteLine("=============================");
            sw.WriteLine(ex.StackTrace);
            sw.WriteLine("-----------------------------");
            sw.Close();
            fs.Close();
        }    
    }
}
